package com.smzd.framework.utils.db;

import com.smzd.core.domain.IOwnedEntity;
import com.smzd.core.domain.IntIdEntity;

/**
 * ORPage：携带owner的RPage。Owner类型只要是IntIdEntity就可以了，但元素类型必须以Owner为Owner。
 * 
 * @author yuzhongda
 * 
 * @param <O> Owner类型参数
 * @param <E> elems类型参数，都以Owner为Owner
 */
public class ORPage<O extends IntIdEntity, E extends IOwnedEntity<O>> extends
		RPage<E> implements Ownerable<O> {
	private O owner;

	public void setOwner(O owner) {
		this.putParam("ownerid", owner == null ? null : owner.getId());
		this.owner = owner;
	}

	public O getOwner() {
		return owner;
	}
}
